using System;
using Castle.ActiveRecord;

namespace IronMis2.Models
{
    [ActiveRecord("storehouse")]
    public class Storehouse:ActiveRecordBase<Storehouse>
    {
        private Guid id;
        private string storId;
        private string storName;
        private string storAddr;
        private Employee employee;
        
        [PrimaryKey(PrimaryKeyType.GuidComb,Column = "id")]
        public Guid Id
        {
            set { id = value; }
            get { return id; }
        }

        [BelongsTo(Column = "s_number",ForeignKey = "id",Insert = true,Update = true,Fetch = FetchEnum.Select)]
        public Employee Employee
        {
            set { employee = value; }
            get { return employee; }
        }

        [Property(Column = "stor_id",SqlType = "char",Length = 10)]
        public string StorId
        {
            set { storId = value; }
            get { return storId; }
        }

        [Property(Column = "stor_name",SqlType = "varchar",Length = 50)]
        public string StorName
        {
            set { storName = value; }
            get { return storName; }
        }

        [Property(Column = "stor_addr",SqlType = "varchar",Length = 50)]
        public string StorAddr
        {
            set { storAddr = value; }
            get { return storAddr; }
        }
    }
}
